package com.zhihao.takeaway.common.utils;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class EasyUITable {
    private Integer total;
    private Object itemList;

    @TableField(exist = false)
    private Object etc;

    public EasyUITable(Integer total,Object itemList){
        this.total = total;
        this.itemList = itemList;
    }
    public EasyUITable(Object itemList){
        this.itemList = itemList;
    }
    @SuppressWarnings("unchecked")
    public void put(String key, Object value) {
        if(etc == null) {
            etc = new HashMap<String, Object>();
        }
        ((Map<String, Object>) etc).put(key, value);
    }
}
